'''
Author: duliang thinktanker@163.com
Date: 2025-09-15 22:58:47
LastEditors: duliang thinktanker@163.com
LastEditTime: 2025-09-15 23:13:01
FilePath: \turn.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''

from ultralytics import YOLO

# 假设你想遍历的文件夹路径是 'path_to_folder'
# path_to_folder = "runs/detect/train18/weights/"

# 使用glob模块找到所有.pt文件
# for pt_file in glob.glob(os.path.join(path_to_folder, "best.pt")):
model = YOLO(r"I:\best.pt")
# Export model
success = model.export(format="onnx")
